package com.fr.report.script.function;

import com.fr.base.StringUtils;
import com.fr.report.script.Function;
import com.fr.report.script.Function.Type;
import com.fr.report.script.NormalFunction;
import com.fr.report.script.Primitive;

public class ISNULL extends NormalFunction
{
  public Object run(Object[] paramArrayOfObject)
  {
    if (paramArrayOfObject.length < 1)
      return Boolean.TRUE;
    Boolean localBoolean = Boolean.TRUE;
    Object localObject = null;
    for (int i = 0; i < paramArrayOfObject.length; ++i)
    {
      localObject = paramArrayOfObject[i];
      if ((Primitive.NULL != localObject) && (((!(localObject instanceof String)) || (!(StringUtils.isEmpty((String)localObject))))))
      {
        localBoolean = Boolean.FALSE;
        break;
      }
    }
    return localBoolean;
  }

  public Function.Type getType()
  {
    return Function.OTHER;
  }

  public String getCN()
  {
    return "ISNULL(object):判断对象中所有的值是否全部都是NULL或者为空字符串。";
  }

  public String getEN()
  {
    return "";
  }
}